<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>IFrame Blur/Focus</title>
	<script type="text/javascript">

window.onload = function()
{
	document.getElementById( 'xIFrame' ).contentWindow.addEventListener( 'blur', IFrame_OnBlur, false ) ;
	document.getElementById( 'xIFrame' ).contentWindow.addEventListener( 'focus', IFrame_OnFocus, false ) ;
}

function IFrame_OnBlur()
{
	var eOutput = document.getElementById( 'xOutput' ) ;
	eOutput.innerHTML = 'Blur: ' + new Date() + '\n' + xOutput.innerHTML ;
}

function IFrame_OnFocus()
{
	var eOutput = document.getElementById( 'xOutput' ) ;
	eOutput.innerHTML = 'Focus: ' + new Date() + '\n' + xOutput.innerHTML ;
}

	</script>
</head>
<body>
	<iframe id="xIFrame" src="contents.html" frameborder="1"></iframe>
	<hr />
	<textarea id="xOutput" rows="15" cols="40" style="width: 100%" readonly="readonly"></textarea>
</body>
</html>
